package collection.ListTest;

/**
 * @author lcx
 *初始化一个简单的单向链表
 */
public class SingleList {
	
	private Node root;
	public SingleList(Node root)
	{
		this.root=root;
	}
	
	public void initSample()
	{
		Node node2=new Node(2);
		Node node3=new Node(3);
		Node node4=new Node(4);
		Node node5=new Node(5);
		root.next=node2;
		node2.next=node3;
		node3.next=node4;
		node4.next=node5;
	}
}

class Node
{
	public int val;
	public Node next;
	public Node(int val)
	{
		this.val=val;
	}
}